package org.apache.flink.runtime.allocatedeploy.execution;

import org.apache.flink.shaded.netty4.io.netty.buffer.ByteBuf;
import org.apache.flink.util.AbstractID;

/**
 * @类名: ExecutionID
 * @说明: ExecutionID
 *
 * @author   leehom
 * @Date	 2024年7月27日 下午11:06:24
 * 修改记录：
 *
 * @see 	 
 */
public class ExecutionID extends AbstractID {

    private static final long serialVersionUID = 1L;
    
    private String resourceKey;

    public ExecutionID() {
        super();
    }

    public ExecutionID(byte[] bytes) {
        super(bytes);
    }

    private ExecutionID(long lowerPart, long upperPart) {
        super(lowerPart, upperPart);
    }

    public void writeTo(ByteBuf buf) {
        buf.writeLong(lowerPart);
        buf.writeLong(upperPart);
    }

    public static ExecutionID fromByteBuf(ByteBuf buf) {
        final long lower = buf.readLong();
        final long upper = buf.readLong();
        return new ExecutionID(lower, upper);
    }

	public String getResourceKey() {
		return resourceKey;
	}

	public void setResourceKey(String resourceKey) {
		this.resourceKey = resourceKey;
	}
    
}
